// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.IndexManagement;

/// <summary>
/// <para>
/// Sampling configuration as returned by the API.
/// </para>
/// </summary>
[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SamplingConfigurationConverter))]
public sealed partial class SamplingConfiguration
{
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public SamplingConfiguration(long creationTimeInMillis, int maxSamples, long maxSizeInBytes, double rate, long timeToLiveInMillis)
	{
		CreationTimeInMillis = creationTimeInMillis;
		MaxSamples = maxSamples;
		MaxSizeInBytes = maxSizeInBytes;
		Rate = rate;
		TimeToLiveInMillis = timeToLiveInMillis;
	}
#if NET7_0_OR_GREATER
	public SamplingConfiguration()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	[System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")]
	public SamplingConfiguration()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal SamplingConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	/// <summary>
	/// <para>
	/// The time when the sampling configuration was created.
	/// </para>
	/// </summary>
	public System.DateTimeOffset? CreationTime { get; set; }

	/// <summary>
	/// <para>
	/// The time when the sampling configuration was created, in milliseconds since epoch.
	/// </para>
	/// </summary>
	public
#if NET7_0_OR_GREATER
	required
#endif
	long CreationTimeInMillis { get; set; }

	/// <summary>
	/// <para>
	/// An optional condition script that sampled documents must satisfy.
	/// </para>
	/// </summary>
	public string? If { get; set; }

	/// <summary>
	/// <para>
	/// The maximum number of documents to sample.
	/// </para>
	/// </summary>
	public
#if NET7_0_OR_GREATER
	required
#endif
	int MaxSamples { get; set; }

	/// <summary>
	/// <para>
	/// The maximum total size of sampled documents.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; }

	/// <summary>
	/// <para>
	/// The maximum total size of sampled documents in bytes.
	/// </para>
	/// </summary>
	public
#if NET7_0_OR_GREATER
	required
#endif
	long MaxSizeInBytes { get; set; }

	/// <summary>
	/// <para>
	/// The fraction of documents to sample between 0 and 1.
	/// </para>
	/// </summary>
	public
#if NET7_0_OR_GREATER
	required
#endif
	double Rate { get; set; }

	/// <summary>
	/// <para>
	/// The duration for which the sampled documents should be retained.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Duration? TimeToLive { get; set; }

	/// <summary>
	/// <para>
	/// The duration for which the sampled documents should be retained, in milliseconds.
	/// </para>
	/// </summary>
	public
#if NET7_0_OR_GREATER
	required
#endif
	long TimeToLiveInMillis { get; set; }
}